home *** CD-ROM | disk | FTP | other *** search
- /* FileToList(fname)
-
- Create a list object on the current page containing the text of the
- given file. The list has the same name as the file, and an arbitrary
- position and size that can be changed to suit. Other characteristics
- come from the default list. This macro should only be used on
- line-oriented text files.
- */
- if open(fr, arg(1), 'r') then do
- list = createlist()
- do forever
- line = readln(fr)
- if eof(fr) then leave
- call appenditem(list, line, 1)
- end
- call close(fr)
- call scaletosize(list, 320, 80)
- call setposition(list, 60, 40)
- call setname(list, arg(1))
- call relocate(list, ':')
- end
- else
- call inform("Unable to open `" || arg(1) || "'")
-